package com.itheima.server.task;

import com.itheima.server.service.ContractService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时更行合同得状态
 */
@Component
@Slf4j
public class ContractJob {
    @Autowired
    private ContractService contractService;

    // 中午12点执行
//    @Scheduled(cron = "0 0 12 * * ?")
    public void executeContract() {
        log.info("开始检查合同状态：12:00");
        contractService.executeContract();
    }

}
